how to use Common Table Expressions in Oracle and SQL server